﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System.Drawing
{
    public static class PointEx
    {
        public static double Distance(this Point point, Point anotherPoint)
        {
            double a = point.X - anotherPoint.X;
            double b = point.Y - anotherPoint.Y;
            double distance = Math.Sqrt(a * a + b * b);
            return distance;
        }

        public static Point Average(this Point point, Point anotherPoint)
        {
            return new Point((point.X + anotherPoint.X) / 2, (point.Y + anotherPoint.Y) / 2);
        }
    }
}
